﻿using UnityEngine;
using UnityEngine.UI;
using System.Collections;
using utils;

public class EndScreen : MonoBehaviour {

	// Use this for initialization
	private Text endScore;
	private Text highScore;

	void Start () 
	{

	}
	
	// Update is called once per frame
	void Update () 
	{
	
	}

	private void initialize()
	{
		GameObject endScore = GameUtils.getChildGameObject(this.gameObject,"txtScore");
		Debug.Log(endScore);
		this.endScore = endScore.GetComponent<Text>();
		
		GameObject highScore = GameUtils.getChildGameObject(this.gameObject,"txtHighScore");
		this.highScore = highScore.GetComponent<Text>();
		
		Debug.Log("Initializing");
	}
	public void show()
	{
		initialize();
		Debug.Log(endScore);
		endScore.text = SessionData.score.ToString();
		highScore.text = PlayerData.highScore.ToString();

	}
}
